Object.defineProperty(exports, "__esModule", { value: !0 }),
  (exports.getMustSeeList =
    exports.getIndexOpenInfo =
    exports.getIndexInfo =
      void 0),
  require("../@babel/runtime/helpers/Arrayincludes");
var e = o(require("../@babel/runtime/regenerator")),
  t = require("../@babel/runtime/helpers/slicedToArray"),
  a = require("../@babel/runtime/helpers/asyncToGenerator"),
  n = require("@/utils/index"),
  i = require("./base/api"),
  r = require("./base/third"),
  u = require("./user-service"),
  s = o(require("@libs/lodash")),
  d = o(require("@/config/index"));
function o(e) {
  return e && e.__esModule ? e : { default: e };
}
var c = (exports.getMustSeeList = function () {
    return new Promise(function (e) {
      e([
        {
          id: "81",
          exhibit_id: "9209E18D-7324-4FF4-AF9B-A06719A57D5F",
          name: "青铜大立人像",
          desc: "“神权与王权最高权力之象征”",
          pic: "".concat(d.default.CDN, "/must-see/1.png"),
          bg: "".concat(d.default.CDN, "/must-see/1_bg.png"),
        },
        {
          id: "104",
          exhibit_id: "8DB1D5DD-A2E7-45D0-9935-271585D9F410",
          name: "青铜神树",
          desc: "“沟通天地的桥梁”",
          pic: "".concat(d.default.CDN, "/must-see/2.png"),
          bg: "".concat(d.default.CDN, "/must-see/2_bg.png"),
        },
        {
          id: "147",
          exhibit_id: "6F12634A-02E1-487A-98F6-A5251052DE72",
          name: "祭山图玉璋",
          desc: "“祭祀山川的礼之重器”",
          pic: "".concat(d.default.CDN, "/must-see/3.png"),
          bg: "".concat(d.default.CDN, "/must-see/3_bg.png"),
        },
        {
          id: "146",
          exhibit_id: "AC240286-3C3C-4A59-BA5F-24775CD9C1DC",
          name: "金杖",
          desc: "“富于浓厚神权色彩的王者之器”",
          pic: "".concat(d.default.CDN, "/must-see/4.png"),
          bg: "".concat(d.default.CDN, "/must-see/4_bg.png"),
        },
        {
          id: "204",
          exhibit_id: "16901847830571501",
          name: "戴立冠青铜人头像",
          desc: "笄发高冠的青铜“诸葛亮”",
          pic: "".concat(d.default.CDN, "/1690180816107_mZiFEYmy.png"),
          bg: "".concat(d.default.CDN, "/1690180759409_WmWnXDd7.png"),
        },
        {
          id: "169",
          exhibit_id: "16901971333714052",
          name: "青铜爬龙器盖",
          desc: "“虎头蛇身，龙形器皿”",
          pic: "".concat(d.default.CDN, "/1690180851921_H6anmpPN.png"),
          bg: "".concat(d.default.CDN, "/1690180835639_GeRKG8TE.png"),
        },
        {
          id: "202",
          exhibit_id: "16901972231329660",
          name: "金面具",
          desc: "“重磅金器，古蜀瑰宝”",
          pic: "".concat(d.default.CDN, "/1690180937902_KrPnNiC3.png"),
          bg: "".concat(d.default.CDN, "/1690180913112_renKDPw2.png"),
        },
        {
          id: "201",
          exhibit_id: "16901973957798144",
          name: "神树纹玉琮",
          desc: "“神树刻痕，玉中珍品”",
          pic: "".concat(d.default.CDN, "/1690180972438_wWj7sfm8.png"),
          bg: "".concat(d.default.CDN, "/1690180955350_S23bNdry.png"),
        },
      ]);
    });
  }),
  l =
    ((exports.getIndexInfo = (function () {
      var i = a(
        e.default.mark(function a() {
          var i, d, o, p, f, g, m, b, x, D, h, _, y, v, C, N, w, T, A, I, L;
          return e.default.wrap(function (e) {
            for (;;)
              switch ((e.prev = e.next)) {
                case 0:
                  return (
                    (e.next = 2),
                    Promise.all([
                      (0, r.postReserveData)(),
                      c(),
                      (0, r.postExplainData)(),
                      (0, r.postGuideData)(),
                      (0, r.postActivityData)(),
                    ])
                  );
                case 2:
                  if (
                    ((i = e.sent),
                    (d = t(i, 5)),
                    (o = d[0]),
                    (p = d[1]),
                    (f = d[2]),
                    (g = d[3]),
                    (m = d[4]),
                    (b = (0, u.getLoginStatus)()),
                    (x = {}),
                    !b)
                  ) {
                    e.next = 16;
                    break;
                  }
                  return (
                    (D = (0, u.getUserInfo)()),
                    (e.next = 15),
                    (0, r.postOrderData)(D.uid)
                  );
                case 15:
                  x = e.sent;
                case 16:
                  return (
                    (h = (0, n.getTime)(
                      s.default.get(o, "data.esbpayload.data.playDay", ""),
                    )),
                    (_ = s.default.get(f, "data.esbpayload.data.records", [])),
                    (y = (0, n.getTime)(s.default.get(_[0], "date", ""))),
                    (v = s.default.get(g, "data.esbpayload.data.records", [])),
                    (C = (0, n.getTime)(s.default.get(v[0], "date", ""))),
                    (N = s.default.get(m, "data.esbpayload.data", [])),
                    (w = s.default.get(x, "data.esbpayload.data", [])),
                    (T = 0),
                    (A = new Date()),
                    (I = A.getHours()),
                    b &&
                    "已购票-未检票" === s.default.get(w[0], "statusName", "")
                      ? (T = 1)
                      : b &&
                          "已购票-已检票" ===
                            s.default.get(w[0], "statusName", "") &&
                          I < 18
                        ? (T = 2)
                        : b &&
                          "已购票-已检票" ===
                            s.default.get(w[0], "statusName", "") &&
                          I >= 18 &&
                          (T = 3),
                    (e.next = 29),
                    l()
                  );
                case 29:
                  return (
                    (L = e.sent),
                    e.abrupt("return", {
                      isLogin: b,
                      reserveTime: h,
                      mustSeeList: p,
                      explainTime: y,
                      guideTime: C,
                      activityList: N,
                      orderInfo: w,
                      status: T,
                      exhibitionListByOne:
                        null == L ? void 0 : L.exhibitionListByOne,
                      exhibitionListByTwo:
                        null == L ? void 0 : L.exhibitionListByTwo,
                    })
                  );
                case 31:
                case "end":
                  return e.stop();
              }
          }, a);
        }),
      );
      return function () {
        return i.apply(this, arguments);
      };
    })()),
    (function () {
      var n = a(
        e.default.mark(function a() {
          var n, r, u, o, c, l, p;
          return e.default.wrap(function (e) {
            for (;;)
              switch ((e.prev = e.next)) {
                case 0:
                  return (
                    (e.next = 2),
                    Promise.all([
                      (0, i.postExhibitionSearch)({
                        pn: 1,
                        rn: 5,
                        category: 1,
                      }),
                      (0, i.postExhibitionSearch)({
                        pn: 1,
                        rn: 5,
                        category: 2,
                      }),
                    ])
                  );
                case 2:
                  return (
                    (n = e.sent),
                    (r = t(n, 2)),
                    (u = r[0]),
                    (o = r[1]),
                    (c = s.default.get(u, "data.list", []).map(function (e) {
                      return {
                        name: e.name,
                        exhibition_id: e.exhibition_id,
                        pic: e.album[0] || d.default.defaultImg,
                        status: "进行中",
                      };
                    })),
                    (l = function (e, t) {
                      var a = new Date(e).getTime(),
                        n = new Date(t).getTime(),
                        i = new Date().getTime();
                      return i > n ? "已结束" : i < a ? "未开始" : "进行中";
                    }),
                    (p = s.default.get(o, "data.list", []).map(function (e) {
                      return {
                        name: e.name,
                        exhibition_id: e.exhibition_id,
                        pic: e.album[0] || d.default.defaultImg,
                        status: l(e.start_day, e.end_day),
                      };
                    })),
                    e.abrupt("return", {
                      exhibitionListByOne: c,
                      exhibitionListByTwo: p,
                    })
                  );
                case 10:
                case "end":
                  return e.stop();
              }
          }, a);
        }),
      );
      return function () {
        return n.apply(this, arguments);
      };
    })());
exports.getIndexOpenInfo = (function () {
  var t = a(
    e.default.mark(function t() {
      var a, n, r, u;
      return e.default.wrap(function (e) {
        for (;;)
          switch ((e.prev = e.next)) {
            case 0:
              return (e.next = 2), (0, i.getOpenInfo)();
            case 2:
              return (
                (a = e.sent),
                (n = [
                  "mp4",
                  "mov",
                  "m4v",
                  "3gp",
                  "avi",
                  "m3u8",
                  "webm",
                  "flv",
                ]),
                (r = (null == a ? void 0 : a.data) || {}),
                (u = s.default.get(r, "url", "").split(".")),
                (r.isVideo = n.includes(u[u.length - 1])),
                e.abrupt("return", r)
              );
            case 8:
            case "end":
              return e.stop();
          }
      }, t);
    }),
  );
  return function () {
    return t.apply(this, arguments);
  };
})();
